//
//  MeSettingViewController.m
//  RainbowFM
//
//  Created by jv on 14-12-7.
//  Copyright (c) 2014年 RB. All rights reserved.
//

#import "MeSettingViewController.h"
#import "CheckUpdateViewController.h"
#import "AboutMeViewController.h"
#import "FeedbackViewController.h"
#import "LeaveWordsViewController.h"

#import "LoginModel.h"

@interface MeSettingViewController ()

@end

@implementation MeSettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.tableView.tableFooterView = [UIView new];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - table delegate



- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSUInteger row = indexPath.row;
    
    switch (row) {
        case 0:
        {
            [SVProgressHUD showSuccessWithStatus:@"已清除缓存" maskType:SVProgressHUDMaskTypeBlack];
        }
            break;
        case 1:
        {
        }
            break;
        case 2:
        {
            CheckUpdateViewController *ctrl = [CheckUpdateViewController new];
            [self.navigationController pushViewController:ctrl animated:YES];
        }
            break;
        case 3:
        {
            
            AboutMeViewController *ctrl = [AboutMeViewController new];
            [self.navigationController pushViewController:ctrl animated:YES];

        }
            break;
        case 4:
        {
            if ([LoginModel sharedModel].userID == nil) {
                UINavigationController *controller = [[UIStoryboard storyboardWithName:@"Login" bundle:nil] instantiateInitialViewController];
                [self presentViewController:controller animated:YES completion:nil];
                return;
            }
            
            UIStoryboard *board = [UIStoryboard storyboardWithName:@"Comperes" bundle:nil];
            LeaveWordsViewController *leaveWordsViewController = [board instantiateViewControllerWithIdentifier:@"LeaveWordsViewController"];
            [leaveWordsViewController setPart:InterlocutionPartOfMyself];
            [self.navigationController pushViewController:leaveWordsViewController animated:YES];

        }
            break;
        default:
            break;
    }
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
